<template>
  <div>
    <!-- cussState:
      0 ：未定义
      1 ：修改信息
      2 ：申请入库
      ...

      可扩展
     -->
    <base-car-ediv 
      @submit="submit"
      :cussState="1"
      ></base-car-ediv>
  </div>
</template>

<script>

  import baseCarEdiv from 'comp/base/baseCarEdit'

  export default {
    components: {
      baseCarEdiv
    },  
    methods: {
      submit (forms) {
        this.$axios
          .post(this.$api.updateCar, forms, {
            "Content-Type": "multipart/form-data"
          })
          .then(res => {
            if (res.data.code != 1) {
              this.$message({
                type: "warning",
                message: res.data.msg
              });
            } else {
              this.$message({
                type: "success",
                message: "修改成功"
              });
              this.$router.push("/car");
            }
          });
      }
    }
    
  }
</script>

